34
Easy2Siksha
1. Read Phase: The transaction reads data and makes changes locally without affecting
the database.
2. Validation Phase: Before committing, the system checks if the changes can be
applied without violating any constraints.
3. Write Phase: If validation is successful, the changes are applied to the database.
If validation fails, the transaction is rolled back. This protocol is effective when transactions
tend to perform many reads but relatively few writes.
Problems Solved by Concurrency Control:
1. Lost Update Problem: This occurs when two transactions update the same data
simultaneously, and one update overwrites the other. Concurrency control ensures
that only one transaction can update the data at a time, preventing this issue.
2. Dirty Reads: By enforcing locks or using timestamp protocols, a transaction is
prevented from reading uncommitted data, ensuring that only valid, committed data
is read.
3. Uncommitted Dependency Problem (also known as the cascading rollback): If a
transaction depends on uncommitted changes made by another transaction, and
that transaction is rolled back, the dependent transaction might also need to be
rolled back. Concurrency control mechanisms, such as strict two-phase locking,
prevent transactions from accessing uncommitted data.
4. Inconsistent Data: Concurrency control ensures that all transactions appear as if
they are executed serially, maintaining data consistency.
Importance of Concurrency Control:
1. Data Integrity: It ensures that the database remains accurate and consistent, even
with multiple transactions occurring at the same time.
2. Efficiency: Allows multiple transactions to be processed simultaneously, improving
system performance and resource utilization.
3. System Reliability: Prevents issues like lost updates or inconsistent data, which could
lead to system failures or inaccurate results.
4. User Satisfaction: In multi-user environments, concurrency control ensures that
each user has a smooth experience without interference from other users’
transactions.
Conclusion:
Concurrency control is essential in a DBMS to manage the simultaneous execution of
transactions while preserving data integrity and ensuring consistent results. Various
mechanisms, like locking protocols, timestamp ordering, and validation-based protocols,
help to achieve this by controlling access to data and resolving potential conflicts. Effective